<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<title>0.0.1</title>
<#include "../com/top.ftl">

<!--中间  主体内容-->
<div class="a_zhuce_text">
	<!--注册步骤-->
	<div class="a_zhuce_buzhou a_zhuce_buzhou2">
		<dl>
			<dt><img src="${ctx}/resources/images/daole/a_zhuce.png"/></dt>
			<dd class="active">用户验证 </dd>
		</dl>
		<dl style="padding:0 37%;">
		     <dt><img src="${ctx}/resources/images/daole/a_zhuce(2).png"/></dt>
			 <dd class="active">修改密码</dd>
		</dl>
		<dl>
			<dt><img src="${ctx}/resources/images/daole/a_zhuce(hui3).png"/></dt>
			<dd>修改成功</dd>
		</dl>
	</div>
	
	<!--信息填写-->
	<form action="${ctx}/doreset${suffix}" method="POST">
	<input type="hidden" name="contact" id="contact" value="${contact!}" />
	<ul class="a_zhuce_info">
		<li>
			<span>设置密码：</span>
			<input type="password" name="password" id="password" maxlength=16 placeholder="请输入6-16位密码" onBlur="checkPwd()"/>
		</li>
		<li>
			<span>确认密码：</span>
			<input type="password" name="qpassword" id="qpassword" maxlength=16 placeholder="请再次确认密码" onBlur="checkPwd()"/><p id="pwdCue" class="xm_p"></p>
		</li>
	</ul>
	<div class="a_next">
		<button type="submit" class="w_bbt" onclick="return checkSub(this.form)">下一步</button>
		 <!--<a href="0.0.1wangjimima3.html">下一步</a>-->
		
	</div>
	</form>
	
	<!--
	 <form action="${ctx}/doreset${suffix}" method="POST">
		<div class="w_zhuce_conl w_czmm clearfix">
            <ul>
            	<input type="hidden" name="contact" id="contact" value="${contact!}" />
                <li><label>设置密码：</label><input type="password" name="password" id="password" maxlength=16 placeholder="请输入6-16位密码" onBlur="checkPwd()"/></li>
                <li><label>再次确认：</label><input type="password" name="qpassword" id="qpassword" maxlength=16 placeholder="请再次确认密码" onBlur="checkPwd()"/><p id="pwdCue" class="xm_p"></p></li>
                <li><button type="submit" class="w_bbt" onclick="return checkSub(this.form)">下一步</button></li>
            </ul>
        </div>    
    </form>
	-->
	
</div>


<script>
	$(document).ready(function(){
		<#if infoMsg??>	
			msgSuccess("${infoMsg}");
		</#if>
		<#if errorMsg??>
			msgError("${errorMsg}");
		</#if>
	})
	
	
	function checkPwd(){
		var password = $("#password").val();
		var qpassword = $("#qpassword").val();
		var url = "${ctx}/check_pwd/"+password+"/"+qpassword;
		var param = {};
		$.getJSON(url, param, function(data){
			if(data.succ == true){ // 验证码发送成功
				$("#pwdCue").hide();
				return true;
			}
			$("#pwdCue").show();
			$("#pwdCue").text(data.msg);
			return false;
		});
	}
	
	function checkSub(){
		var names = "password,密码;qpassword,确定密码";
		var password = $("#password").val();
		var qpassword = $("#qpassword").val();
		if(password.length < 6 || qpassword.length < 6){
			$("#pwdCue").show();
			$("#pwdCue").text("密码长度不能小与6位!");
			return false;
		}
		if(password != qpassword){
			$("#pwdCue").show();
			$("#pwdCue").text("两次密码不一致");
			return false;
		}
		return checkCommit(names);
	}
</script>


<#include "../com/foot.ftl">